﻿@model Yqblog.ViewModels.ArticleViewModel
@using System.Text;
@using lang = Resource.Web;
@{
    ViewBag.Title = Model.Category.CateName + " - " + Model.ArticleInfo.title;
    ViewBag.Category = Model.Category;
}
@section Seo{
    @Html.Raw(ViewBag.Seo)
}
<input type="hidden" value="@Model.ArticleInfo.articleid" id="ArticleId" name="ArticleId"/>
<div class="row">
    <div class="col-md-12">
        <ul class="breadcrumb">
        <li>@Html.ActionLink(lang.HomePage, "Index", "Home") <span class="divider">/</span></li>
        @Html.Raw(Model.WebPath)
        <li class="active">@Model.ArticleInfo.title</li>
        </ul>
    </div>
    <div class="col-md-12">
        <h3>@Model.ArticleInfo.title</h3>
        <p class="article_meta">
            <a href="@Html.YqUrl("/author/" + Model.ArticleInfo.username)">@Model.ArticleInfo.username.Trim()</a>
            @lang.PostedOn
            @Html.GetTime(Model.ArticleInfo.createdate)
            <span class="ui-icon ui-icon-folder-collapsed"></span>
            <a href="@Html.GetCateUrl(Model.Category)" >@Model.Category.CateName</a>
            <span class="article_viewcount"></span>
            <span class="article_commentcount"></span>
        </p>
        <div>@Html.Raw(Model.ArticleInfo.summary)</div>
        <div class="article_content">@Html.Raw(Model.ArticleInfo.content)</div>
        <div class="article_tag text-muted">
            @foreach (var tag in Model.ArticleInfo.tags.Split(',').Where(tag => !string.IsNullOrEmpty(tag.Trim())))
            {
                <a class="grayBoxA" href="@Html.YqUrl("/tag/" + HttpUtility.UrlEncode(tag.Replace(".", "@"), Encoding.UTF8).Replace("+", "%20"))">@tag</a>
            }
        </div>
        <div class="vote articlevote clearfix" voteid="@Model.ArticleInfo.articleid">
            <ul>
                <li>@lang.Vote_Up :</li>
                <li class="vote_favor vote_favor_value"></li>
                <li class="gap"></li>
                <li>@lang.Vote_Down :</li>
                <li class="vote_against vote_against_value"></li>
                <li class="vote_tip"></li>
            </ul>
        </div>
        <div class="article_link"></div>
        <div class="article_comment">
            <input type="hidden" value="desc" id="CommentOrderType" name="CommentOrderType"/>
            <a name="commentA"></a>
            <div id="commentlist">
            </div>
            <div id="commentform">
                <a name="commentFormA"></a>
                <h4>@lang.AddComment</h4>
                <div id="commentFormWrap"></div>
            </div>
        </div>
    </div>
</div>
<input type="hidden" value="" id="current-comment" name="current-comment"/>

<div id="modalbackdroptrue" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h3>@lang.DeleteComment</h3>
        </div>
        <div class="modal-body">
            <p>
                @lang.DeleteTip_AreUSureDelete
            </p>
        </div>
        <div class="modal-footer">
            <a data-dismiss="modal" class="btn btn-default" id="comment-delete-no">@lang.No</a>
            <a class="btn btn-primary" id="comment-delete-yes">@lang.Yes</a>
        </div>
    </div>
  </div>
</div>

@section Js{
    <script src="@Url.Content("~/Scripts/SyntaxHighlighter/scripts/shCore.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/SyntaxHighlighter/scripts/shBrush.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('.article_link').html(loadingImgSmall);
            GetArticleAjaxInfo();
            GetCommentForm();
            SyntaxHighlighter.all();
        });
    </script>
}